<html><body>
<style>

body, h1, h2, h3, div, span, p, pre, a {
  margin: 0;
  padding: 0;
  border: 0;
  font-weight: inherit;
  font-style: inherit;
  font-size: 100%;
  font-family: inherit;
  vertical-align: baseline;
}

body {
  font-size: 13px;
  padding: 1em;
}

h1 {
  font-size: 26px;
  margin-bottom: 1em;
}

h2 {
  font-size: 24px;
  margin-bottom: 1em;
}

h3 {
  font-size: 20px;
  margin-bottom: 1em;
  margin-top: 1em;
}

pre, code {
  line-height: 1.5;
  font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
}

pre {
  margin-top: 0.5em;
}

h1, h2, h3, p {
  font-family: Arial, sans serif;
}

h1, h2, h3 {
  border-bottom: solid #CCC 1px;
}

.toc_element {
  margin-top: 0.5em;
}

.firstline {
  margin-left: 2 em;
}

.method  {
  margin-top: 1em;
  border: solid 1px #CCC;
  padding: 1em;
  background: #EEE;
}

.details {
  font-weight: bold;
  font-size: 14px;
}

</style>

<h1><a href="compute_alpha.html">Compute Engine API</a> . <a href="compute_alpha.advice.html">advice</a></h1>
<h2>Instance Methods</h2>
<p class="toc_element">
  <code><a href="#calendarMode">calendarMode(project, region, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Advise how, where and when to create the requested amount of instances</p>
<p class="toc_element">
  <code><a href="#capacity">capacity(project, region, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Advice on making real-time decisions (such as choosing zone or</p>
<p class="toc_element">
  <code><a href="#close">close()</a></code></p>
<p class="firstline">Close httplib2 connections.</p>
<h3>Method Details</h3>
<div class="method">
    <code class="details" id="calendarMode">calendarMode(project, region, body=None, x__xgafv=None)</code>
  <pre>Advise how, where and when to create the requested amount of instances
with specified accelerators, within the specified time and location limits.
The method recommends creating future reservations for the requested
resources.

Args:
  project: string, Project ID for this request. (required)
  region: string, Name of the region for this request. (required)
  body: object, The request body.
    The object takes the form of:

{ # A request to recommend the best way to consume the specified resources in the
    # future.
  &quot;futureResourcesSpecs&quot;: { # Specification of resources to create in the future.
      # The key of the map is an arbitrary string specified by the caller.
      # Value of the map is a specification of required resources and their
      # constraints. Currently only one value is allowed in this map.
    &quot;a_key&quot;: { # Specification of resources to be created at some time in the future within an
        # optionally specified set of locations, and within the specified time range.
      &quot;deploymentType&quot;: &quot;A String&quot;, # Indicates if the reservation allocation strategy is static (DENSE) or
          # dynamic (STANDARD). Defaults to DENSE.
      &quot;locationPolicy&quot;: { # Specification of locations to create resources in. # Optional location policy allowing to exclude some zone(s) in which
          # the resources must not be created.
        &quot;locations&quot;: { # Preferences for specified locations.
            # Keys of the map are locations - zones, in format of &#x27;zones/&#x27;.
            # Values are preferences for the zones.
            # If a zone is not specified in this map, it is ALLOWed.
          &quot;a_key&quot;: { # Preference for a single specified location.
            &quot;preference&quot;: &quot;A String&quot;, # Preference for this location.
          },
        },
      },
      &quot;targetResources&quot;: { # Specification of reserved resources. # Specification of the reserved resources.
        &quot;aggregateResources&quot;: {
          &quot;acceleratorCount&quot;: &quot;A String&quot;, # Size of the request, in accelerator (chip) count.
          &quot;vmFamily&quot;: &quot;A String&quot;, # The VM family that all instances scheduled against this reservation
              # must belong to. Use for TPU reservations.
          &quot;workloadType&quot;: &quot;A String&quot;, # Workload type. Use for TPU reservations.
        },
        &quot;specificSkuResources&quot;: {
          &quot;instanceCount&quot;: &quot;A String&quot;, # Size of the request, in instance count.
          &quot;localSsdPartitions&quot;: [ # Local SSD partitions. You do not have to include SSD partitions that
              # are built in the machine type.
            {
              &quot;diskInterface&quot;: &quot;A String&quot;, # Disk interface. Defaults to SCSI.
              &quot;diskSizeGb&quot;: &quot;A String&quot;, # The size of the disk in GB.
            },
          ],
          &quot;machineType&quot;: &quot;A String&quot;, # The machine type to use for instances that will use the reservation.
              # This field only accepts machine type names. e.g. n2-standard-4
              # and does not accept machine type full or partial url. e.g.
              # projects/my-l7ilb-project/zones/us-central1-a/machineTypes/n2-standard-4.
              # Use for GPU reservations.
        },
      },
      &quot;timeRangeSpec&quot;: { # A flexible specification of a time range that has 3 points of # Specification of a time range in which the resources may be created.
          # The time range specifies start of resource use and planned end of resource
          # use.
          # flexibility: (1) a flexible start time, (2) a flexible end time, (3) a
          # flexible duration.
          #
          # It is possible to specify a contradictory time range that cannot be matched
          # by any Interval. This causes a validation error.
        &quot;endTimeNotEarlierThan&quot;: &quot;A String&quot;,
        &quot;endTimeNotLaterThan&quot;: &quot;A String&quot;,
        &quot;maxDuration&quot;: &quot;A String&quot;,
        &quot;minDuration&quot;: &quot;A String&quot;,
        &quot;startTimeNotEarlierThan&quot;: &quot;A String&quot;,
        &quot;startTimeNotLaterThan&quot;: &quot;A String&quot;,
      },
    },
  },
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A response containing the recommended way of creating the specified resources
    # in the future. It contains (will contain) multiple recommendations that can
    # be analyzed by the customer and the best one can be picked.
  &quot;recommendations&quot;: [ # Recommendations where, how and when to create the requested resources
      # in order to maximize their obtainability and minimize cost.
    { # A single recommendation to create requested resources. Contains detailed
        # recommendations for every future resources specification specified in
        # CalendarModeAdviceRequest.
      &quot;recommendationsPerSpec&quot;: { # Recommendations for every future resource specification passed in
          # CalendarModeAdviceRequest. Keys of the map correspond to keys
          # specified in the request.
        &quot;a_key&quot;: { # Recommendation for single resources specification, to be created in the
            # future.
          &quot;endTime&quot;: &quot;A String&quot;,
          &quot;location&quot;: &quot;A String&quot;, # The advised location for resource usage. When a zone, in format
              # &#x27;zones/&#x27;.
              # If not set, it means that no location is recommended - see
              # other_locations for details.
          &quot;otherLocations&quot;: { # List of locations in the request scope that were not
              # recommended. Keys of the map are zones, in format &#x27;zones/&#x27;.
              # The values are status information indicating the recommendation status.
            &quot;a_key&quot;: { # Information about recommendation status for locations
                # that were allowed but not used by the response.
              &quot;details&quot;: &quot;A String&quot;, # Details (human readable) describing the situation.
                  # For example, if status is CONDITION_NOT_MET, then
                  # details contain information about the parameters of the time window
                  # that did not meet the required conditions.
              &quot;status&quot;: &quot;A String&quot;, # Status of recommendation in this location.
            },
          },
          &quot;recommendationId&quot;: &quot;A String&quot;, # Unique id of the recommendation, a UUID string generated by the API.
          &quot;recommendationType&quot;: &quot;A String&quot;, # Type of recommendation. Currently only FUTURE_RESERVATION is supported.
          &quot;startTime&quot;: &quot;A String&quot;,
        },
      },
    },
  ],
}</pre>
</div>

<div class="method">
    <code class="details" id="capacity">capacity(project, region, body=None, x__xgafv=None)</code>
  <pre>Advice on making real-time decisions (such as choosing zone or
machine types) during deployment to maximize your chances of obtaining
capacity.

Args:
  project: string, Project ID for this request. (required)
  region: string, Name of the region for this request. (required)
  body: object, The request body.
    The object takes the form of:

{ # A request to provide Assistant Scores. These scores determine VM
    # obtainability and preemption likelihood.
  &quot;distributionPolicy&quot;: { # Policy specifying the distribution of instances across
      # zones within the requested region.
    &quot;targetShape&quot;: &quot;A String&quot;, # The distribution shape to which the group converges.
        # You can only specify the following values: ANY,ANY_SINGLE_ZONE.
    &quot;zones&quot;: [ # Zones where Capacity Advisor looks for capacity.
      {
        &quot;zone&quot;: &quot;A String&quot;, # The URL of the zone. It can be a
            # partial or full URL. For example, the following are valid values:
            #
            #
            #      - https://www.googleapis.com/compute/v1/projects/project/zones/zone
            #    - projects/project/zones/zone
            #    - zones/zone
      },
    ],
  },
  &quot;instanceFlexibilityPolicy&quot;: { # Specification of alternative, flexible instance subsets. # Policy for instance selectors.
    &quot;instanceSelections&quot;: { # Named instance selections configure properties.
        # The key is an arbitrary, unique RFC1035 string that identifies the
        # instance selection.
      &quot;a_key&quot;: { # Machine specification.
        &quot;machineTypes&quot;: [ # Full machine-type names, e.g. &quot;n1-standard-16&quot;.
          &quot;A String&quot;,
        ],
      },
    },
  },
  &quot;instanceProperties&quot;: { # Instance provisining properties. # Instance properties for this request.
    &quot;scheduling&quot;: { # Defines the instance scheduling options. # Specifies the scheduling options.
      &quot;provisioningModel&quot;: &quot;A String&quot;, # Specifies the provisioning model of the instance.
    },
  },
  &quot;size&quot;: 42, # Size of requested capacity.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A response contains multiple scoring recommendations.
  &quot;recommendations&quot;: [ # Initially the API will provide one recommendation which balances the
      # individual scores according to service provider&#x27;s preference.
    {
      &quot;scores&quot;: { # The Scores message groups information about a shard of capacity.
        &quot;obtainability&quot;: 3.14, # The obtainability score indicates the likelihood of successfully
            # obtaining (provisioning) the requested number of VMs.
            # The score range is 0.0 through 1.0. Higher is better.
        &quot;uptimeScore&quot;: 3.14, # The uptime score indicates the likelihood that your Spot VMs will
            # continue to run without preemption within the next few hours. For more
            # information about the preemption process, see Preemption
            # of Spot VMs.
            # The score range is 0.0 through 1.0. Higher is better.
      },
      &quot;shards&quot;: [
        { # Shards represent blocks of uniform capacity in recommendations.
            # Each shard is for a single zone, single instance selection, and
            # a single machine shape. Each shard defines a size expressed as the
            # number of VMs.
          &quot;instanceCount&quot;: 42,
          &quot;machineType&quot;: &quot;A String&quot;, # The machine type corresponds to the instance selection in the request.
          &quot;provisioningModel&quot;: &quot;A String&quot;, # The provisioning model that you want to view recommendations for.
              # Set to: SPOT.
              #
              # For more information, see
              # Compute Engine instances provisioning models.
          &quot;zone&quot;: &quot;A String&quot;, # The zone name for this shard.
        },
      ],
    },
  ],
}</pre>
</div>

<div class="method">
    <code class="details" id="close">close()</code>
  <pre>Close httplib2 connections.</pre>
</div>

</body></html>